home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 July: Mac OS SDK / Dev.CD Jul 99 SDK1.toast / Development Kits / Mac OS / Interfaces&Libraries / Universal / Interfaces / AIncludes / SCSI.a < prev    next >
Encoding:
Text File  |  1998-08-17  |  50.7 KB  |  1,031 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        SCSI.a
  3. ;
  4. ;    Contains:    SCSI Family Interfaces.
  5. ;
  6. ;    Version:    Technology:    SCSI 4.3
  7. ;                Release:    Universal Interfaces 3.2
  8. ;
  9. ;    Copyright:    © 1986-1998 by Apple Computer, Inc., all rights reserved
  10. ;
  11. ;    Bugs?:        For bug reports, consult the following page on
  12. ;                the World Wide Web:
  13. ;
  14. ;                    http://developer.apple.com/bugreporter/
  15. ;
  16. ;
  17.     IF &TYPE('__SCSI__') = 'UNDEFINED' THEN
  18. __SCSI__ SET 1
  19.  
  20.     IF &TYPE('__MACTYPES__') = 'UNDEFINED' THEN
  21.     include 'MacTypes.a'
  22.     ENDIF
  23.     IF &TYPE('__MIXEDMODE__') = 'UNDEFINED' THEN
  24.     include 'MixedMode.a'
  25.     ENDIF
  26.  
  27. ;  SCSI Manager errors. These are generated by Inside Mac IV calls only. 
  28.  
  29. scCommErr                        EQU        2                    ; communications error, operation timeout 
  30. scArbNBErr                        EQU        3                    ; arbitration timeout waiting for not BSY 
  31. scBadParmsErr                    EQU        4                    ; bad parameter or TIB opcode 
  32. scPhaseErr                        EQU        5                    ; SCSI bus not in correct phase for attempted operation 
  33. scCompareErr                    EQU        6                    ; data compare error 
  34. scMgrBusyErr                    EQU        7                    ; SCSI Manager busy  
  35. scSequenceErr                    EQU        8                    ; attempted operation is out of sequence 
  36. scBusTOErr                        EQU        9                    ; CPU bus timeout 
  37. scComplPhaseErr                    EQU        10                    ; SCSI bus wasn't in Status phase 
  38. ;  TIB opcodes 
  39.  
  40. scInc                            EQU        1
  41. scNoInc                            EQU        2
  42. scAdd                            EQU        3
  43. scMove                            EQU        4
  44. scLoop                            EQU        5
  45. scNop                            EQU        6
  46. scStop                            EQU        7
  47. scComp                            EQU        8
  48. ;  Signatures 
  49.  
  50. sbSIGWord                        EQU        $4552                ; signature word for Block 0 ('ER') 
  51. sbMac                            EQU        1                    ; system type for Mac 
  52. pMapSIG                            EQU        $504D                ; partition map signature ('PM') 
  53. pdSigWord                        EQU        $5453
  54.  
  55. oldPMSigWord                    EQU        $5453
  56. newPMSigWord                    EQU        $504D
  57. ;  Driver Descriptor Map 
  58. Block0                    RECORD 0
  59. sbSig                     ds.w    1                ; offset: $0 (0)        ;  unique value for SCSI block 0 
  60. sbBlkSize                 ds.w    1                ; offset: $2 (2)        ;  block size of device 
  61. sbBlkCount                 ds.l    1                ; offset: $4 (4)        ;  number of blocks on device 
  62. sbDevType                 ds.w    1                ; offset: $8 (8)        ;  device type 
  63. sbDevId                     ds.w    1                ; offset: $A (10)        ;  device id 
  64. sbData                     ds.l    1                ; offset: $C (12)        ;  not used 
  65. sbDrvrCount                 ds.w    1                ; offset: $10 (16)        ;  driver descriptor count 
  66. ddBlock                     ds.l    1                ; offset: $12 (18)        ;  1st driver's starting block 
  67. ddSize                     ds.w    1                ; offset: $16 (22)        ;  size of 1st driver (512-byte blks) 
  68. ddType                     ds.w    1                ; offset: $18 (24)        ;  system type (1 for Mac+) 
  69. ddPad                     ds.w    243                ; offset: $1A (26)        ;  ARRAY[0..242] OF INTEGER; not used 
  70. sizeof                     EQU *                    ; size:   $200 (512)
  71.                         ENDR
  72. ;  Driver descriptor 
  73. DDMap                    RECORD 0
  74. ddBlock                     ds.l    1                ; offset: $0 (0)        ;  1st driver's starting block 
  75. ddSize                     ds.w    1                ; offset: $4 (4)        ;  size of 1st driver (512-byte blks) 
  76. ddType                     ds.w    1                ; offset: $6 (6)        ;  system type (1 for Mac+) 
  77. sizeof                     EQU *                    ; size:   $8 (8)
  78.                         ENDR
  79. ;  Partition Map Entry 
  80. Partition                RECORD 0
  81. pmSig                     ds.w    1                ; offset: $0 (0)        ;  unique value for map entry blk 
  82. pmSigPad                 ds.w    1                ; offset: $2 (2)        ;  currently unused 
  83. pmMapBlkCnt                 ds.l    1                ; offset: $4 (4)        ;  # of blks in partition map 
  84. pmPyPartStart             ds.l    1                ; offset: $8 (8)        ;  physical start blk of partition 
  85. pmPartBlkCnt             ds.l    1                ; offset: $C (12)        ;  # of blks in this partition 
  86. pmPartName                 ds.b    32                ; offset: $10 (16)        ;  ASCII partition name 
  87. pmParType                 ds.b    32                ; offset: $30 (48)        ;  ASCII partition type 
  88. pmLgDataStart             ds.l    1                ; offset: $50 (80)        ;  log. # of partition's 1st data blk 
  89. pmDataCnt                 ds.l    1                ; offset: $54 (84)        ;  # of blks in partition's data area 
  90. pmPartStatus             ds.l    1                ; offset: $58 (88)        ;  bit field for partition status 
  91. pmLgBootStart             ds.l    1                ; offset: $5C (92)        ;  log. blk of partition's boot code 
  92. pmBootSize                 ds.l    1                ; offset: $60 (96)        ;  number of bytes in boot code 
  93. pmBootAddr                 ds.l    1                ; offset: $64 (100)        ;  memory load address of boot code 
  94. pmBootAddr2                 ds.l    1                ; offset: $68 (104)        ;  currently unused 
  95. pmBootEntry                 ds.l    1                ; offset: $6C (108)        ;  entry point of boot code 
  96. pmBootEntry2             ds.l    1                ; offset: $70 (112)        ;  currently unused 
  97. pmBootCksum                 ds.l    1                ; offset: $74 (116)        ;  checksum of boot code 
  98. pmProcessor                 ds.b    16                ; offset: $78 (120)        ;  ASCII for the processor type 
  99. pmPad                     ds.w    188                ; offset: $88 (136)        ;  ARRAY[0..187] OF INTEGER; not used 
  100. sizeof                     EQU *                    ; size:   $200 (512)
  101.                         ENDR
  102. ;  TIB instruction 
  103. SCSIInstr                RECORD 0
  104. scOpcode                 ds.w    1                ; offset: $0 (0)
  105. scParam1                 ds.l    1                ; offset: $2 (2)
  106. scParam2                 ds.l    1                ; offset: $6 (6)
  107. sizeof                     EQU *                    ; size:   $A (10)
  108.                         ENDR
  109. ;  SCSI Phases (used by SIMs to support the Original SCSI Manager 
  110.  
  111. kDataOutPhase                    EQU        0                    ; Encoded MSG, C/D, I/O bits 
  112. kDataInPhase                    EQU        1
  113. kCommandPhase                    EQU        2
  114. kStatusPhase                    EQU        3
  115. kPhaseIllegal0                    EQU        4
  116. kPhaseIllegal1                    EQU        5
  117. kMessageOutPhase                EQU        6
  118. kMessageInPhase                    EQU        7
  119. kBusFreePhase                    EQU        8                    ; Additional Phases 
  120. kArbitratePhase                    EQU        9
  121. kSelectPhase                    EQU        10
  122. kMessageInPhaseNACK                EQU        11                    ; Message In Phase with ACK hanging on the bus 
  123.  
  124. ;
  125. ; pascal OSErr SCSIReset(void )
  126. ;
  127.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  128.         Macro
  129.         _SCSIReset
  130.             clr.w               -(sp)
  131.             dc.w                $A815
  132.         EndM
  133.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  134.         IMPORT_CFM_FUNCTION SCSIReset
  135.     ENDIF
  136.  
  137. ;
  138. ; pascal OSErr SCSIGet(void )
  139. ;
  140.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  141.         Macro
  142.         _SCSIGet
  143.             move.w              #$0001,-(sp)
  144.             dc.w                $A815
  145.         EndM
  146.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  147.         IMPORT_CFM_FUNCTION SCSIGet
  148.     ENDIF
  149.  
  150. ;
  151. ; pascal OSErr SCSISelect(short targetID)
  152. ;
  153.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  154.         Macro
  155.         _SCSISelect
  156.             move.w              #$0002,-(sp)
  157.             dc.w                $A815
  158.         EndM
  159.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  160.         IMPORT_CFM_FUNCTION SCSISelect
  161.     ENDIF
  162.  
  163. ;
  164. ; pascal OSErr SCSICmd(Ptr buffer, short count)
  165. ;
  166.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  167.         Macro
  168.         _SCSICmd
  169.             move.w              #$0003,-(sp)
  170.             dc.w                $A815
  171.         EndM
  172.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  173.         IMPORT_CFM_FUNCTION SCSICmd
  174.     ENDIF
  175.  
  176. ;
  177. ; pascal OSErr SCSIRead(Ptr tibPtr)
  178. ;
  179.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  180.         Macro
  181.         _SCSIRead
  182.             move.w              #$0005,-(sp)
  183.             dc.w                $A815
  184.         EndM
  185.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  186.         IMPORT_CFM_FUNCTION SCSIRead
  187.     ENDIF
  188.  
  189. ;
  190. ; pascal OSErr SCSIRBlind(Ptr tibPtr)
  191. ;
  192.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  193.         Macro
  194.         _SCSIRBlind
  195.             move.w              #$0008,-(sp)
  196.             dc.w                $A815
  197.         EndM
  198.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  199.         IMPORT_CFM_FUNCTION SCSIRBlind
  200.     ENDIF
  201.  
  202. ;
  203. ; pascal OSErr SCSIWrite(Ptr tibPtr)
  204. ;
  205.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  206.         Macro
  207.         _SCSIWrite
  208.             move.w              #$0006,-(sp)
  209.             dc.w                $A815
  210.         EndM
  211.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  212.         IMPORT_CFM_FUNCTION SCSIWrite
  213.     ENDIF
  214.  
  215. ;
  216. ; pascal OSErr SCSIWBlind(Ptr tibPtr)
  217. ;
  218.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  219.         Macro
  220.         _SCSIWBlind
  221.             move.w              #$0009,-(sp)
  222.             dc.w                $A815
  223.         EndM
  224.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  225.         IMPORT_CFM_FUNCTION SCSIWBlind
  226.     ENDIF
  227.  
  228. ;
  229. ; pascal OSErr SCSIComplete(short *stat, short *message, unsigned long wait)
  230. ;
  231.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  232.         Macro
  233.         _SCSIComplete
  234.             move.w              #$0004,-(sp)
  235.             dc.w                $A815
  236.         EndM
  237.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  238.         IMPORT_CFM_FUNCTION SCSIComplete
  239.     ENDIF
  240.  
  241. ;
  242. ; pascal short SCSIStat(void )
  243. ;
  244.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  245.         Macro
  246.         _SCSIStat
  247.             move.w              #$000A,-(sp)
  248.             dc.w                $A815
  249.         EndM
  250.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  251.         IMPORT_CFM_FUNCTION SCSIStat
  252.     ENDIF
  253.  
  254. ;
  255. ; pascal OSErr SCSISelAtn(short targetID)
  256. ;
  257.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  258.         Macro
  259.         _SCSISelAtn
  260.             move.w              #$000B,-(sp)
  261.             dc.w                $A815
  262.         EndM
  263.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  264.         IMPORT_CFM_FUNCTION SCSISelAtn
  265.     ENDIF
  266.  
  267. ;
  268. ; pascal OSErr SCSIMsgIn(short *message)
  269. ;
  270.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  271.         Macro
  272.         _SCSIMsgIn
  273.             move.w              #$000C,-(sp)
  274.             dc.w                $A815
  275.         EndM
  276.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  277.         IMPORT_CFM_FUNCTION SCSIMsgIn
  278.     ENDIF
  279.  
  280. ;
  281. ; pascal OSErr SCSIMsgOut(short message)
  282. ;
  283.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  284.         Macro
  285.         _SCSIMsgOut
  286.             move.w              #$000D,-(sp)
  287.             dc.w                $A815
  288.         EndM
  289.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  290.         IMPORT_CFM_FUNCTION SCSIMsgOut
  291.     ENDIF
  292.  
  293.  
  294.  
  295. scsiVERSION                        EQU        43
  296.  
  297. ; * SCSI Callback Procedure Prototypes. Several of these are only callable
  298. ; * from SCSI Manager 4.3 SIM and XPT contexts. 
  299.  
  300. ;  SCSIInterruptPollProcPtr is obsolete (use SCSIInterruptProcPtr) but still here for compatibility 
  301. ;  SCSI Manager 4.3 function codes 
  302.  
  303. SCSINop                            EQU        $00                    ; Execute nothing                                         
  304. SCSIExecIO                        EQU        $01                    ; Execute the specified IO                             
  305. SCSIBusInquiry                    EQU        $03                    ; Get parameters for entire path of HBAs                 
  306. SCSIReleaseQ                    EQU        $04                    ; Release the frozen SIM queue for particular LUN         
  307. SCSIAbortCommand                EQU        $10                    ; Abort the selected Control Block                      
  308. SCSIResetBus                    EQU        $11                    ; Reset the SCSI bus                                      
  309. SCSIResetDevice                    EQU        $12                    ; Reset the SCSI device                                  
  310. SCSITerminateIO                    EQU        $13                    ; Terminate any pending IO                              
  311. SCSIGetVirtualIDInfo            EQU        $80                    ; Find out which bus old ID is on                         
  312. SCSILoadDriver                    EQU        $82                    ; Load a driver for a device ident                     
  313. SCSIOldCall                        EQU        $84                    ; XPT->SIM private call for old-API                     
  314. SCSICreateRefNumXref            EQU        $85                    ; Register a DeviceIdent to drvr RefNum xref             
  315. SCSILookupRefNumXref            EQU        $86                    ; Get DeviceIdent to drvr RefNum xref                     
  316. SCSIRemoveRefNumXref            EQU        $87                    ; Remove a DeviceIdent to drvr RefNum xref             
  317. SCSIRegisterWithNewXPT            EQU        $88                    ; XPT has changed - SIM needs to re-register itself     
  318. vendorUnique                    EQU        $C0                    ; 0xC0 thru 0xFF 
  319.  
  320. ;  Allocation length defines for some of the fields 
  321.  
  322. handshakeDataLength                EQU        8                    ; Handshake data length 
  323. maxCDBLength                    EQU        16                    ; Space for the CDB bytes/pointer 
  324. vendorIDLength                    EQU        16                    ; ASCII string len for Vendor ID  
  325. ;  Define DeviceIdent structure 
  326. DeviceIdent                RECORD 0
  327. diReserved                 ds.b    1                ; offset: $0 (0)        ;  reserved                 
  328. bus                         ds.b    1                ; offset: $1 (1)        ;  SCSI - Bus Number        
  329. targetID                 ds.b    1                ; offset: $2 (2)        ;  SCSI - Target SCSI ID    
  330. LUN                         ds.b    1                ; offset: $3 (3)        ;  SCSI - LUN                  
  331. sizeof                     EQU *                    ; size:   $4 (4)
  332.                         ENDR
  333. ;  Command Descriptor Block structure 
  334. CDB                        RECORD 0
  335. cdbPtr                     ds.l    1                ; offset: $0 (0)        ;  pointer to the CDB, or 
  336.                          ORG 0
  337. cdbBytes                 ds.b    16                ; offset: $0 (0)        ;  the actual CDB to send 
  338. sizeof                     EQU *                    ; size:   $10 (16)
  339.                         ENDR
  340. ; typedef union CDB *                    CDBPtr
  341.  
  342. ;  Scatter/gather list element (Deprecated for MacOS8) 
  343. SGRecord                RECORD 0
  344. SGAddr                     ds.l    1                ; offset: $0 (0)
  345. SGCount                     ds.l    1                ; offset: $4 (4)
  346. sizeof                     EQU *                    ; size:   $8 (8)
  347.                         ENDR
  348. SCSIHdr                    RECORD 0
  349. qLink                     ds.l    1                ; offset: $0 (0)        ;  (internal use, must be nil on entry)    
  350. scsiReserved1             ds.w    1                ; offset: $4 (4)        ;  ->     reserved for input                
  351. scsiPBLength             ds.w    1                ; offset: $6 (6)        ;  -> Length of the entire PB            
  352. scsiFunctionCode         ds.b    1                ; offset: $8 (8)        ;  -> function selector                 
  353. scsiReserved2             ds.b    1                ; offset: $9 (9)        ;  <-     reserved for output                
  354. scsiResult                 ds.w    1                ; offset: $A (10)        ;  <- Returned result                     
  355. scsiDevice                 ds        DeviceIdent        ; offset: $C (12)        ;  -> Device Identifier (bus+target+lun)
  356. scsiCompletion             ds.l    1                ; offset: $10 (16)        ;  -> Callback on completion function      
  357. scsiFlags                 ds.l    1                ; offset: $14 (20)        ;  -> assorted flags                    
  358. scsiDriverStorage         ds.l    1                ; offset: $18 (24)        ;  <> Ptr for driver private use        
  359. scsiXPTprivate             ds.l    1                ; offset: $1C (28)        ;  private field for use in XPT            
  360. scsiReserved3             ds.l    1                ; offset: $20 (32)        ;  reserved                                
  361. sizeof                     EQU *                    ; size:   $24 (36)
  362.                         ENDR
  363. SCSI_PB                    RECORD 0
  364. qLink                     ds.l    1                ; offset: $0 (0)        ;  (internal use, must be nil on entry)    
  365. scsiReserved1             ds.w    1                ; offset: $4 (4)        ;  ->     reserved for input                
  366. scsiPBLength             ds.w    1                ; offset: $6 (6)        ;  -> Length of the entire PB            
  367. scsiFunctionCode         ds.b    1                ; offset: $8 (8)        ;  -> function selector                 
  368. scsiReserved2             ds.b    1                ; offset: $9 (9)        ;  <-     reserved for output                
  369. scsiResult                 ds.w    1                ; offset: $A (10)        ;  <- Returned result                     
  370. scsiDevice                 ds        DeviceIdent        ; offset: $C (12)        ;  -> Device Identifier (bus+target+lun)
  371. scsiCompletion             ds.l    1                ; offset: $10 (16)        ;  -> Callback on completion function      
  372. scsiFlags                 ds.l    1                ; offset: $14 (20)        ;  -> assorted flags                    
  373. scsiDriverStorage         ds.l    1                ; offset: $18 (24)        ;  <> Ptr for driver private use        
  374. scsiXPTprivate             ds.l    1                ; offset: $1C (28)        ;  private field for use in XPT            
  375. scsiReserved3             ds.l    1                ; offset: $20 (32)        ;  reserved                                
  376. sizeof                     EQU *                    ; size:   $24 (36)
  377.                         ENDR
  378. SCSI_IO                    RECORD 0
  379. qLink                     ds.l    1                ; offset: $0 (0)        ;  (internal use, must be nil on entry)    
  380. scsiReserved1             ds.w    1                ; offset: $4 (4)        ;  ->     reserved for input                
  381. scsiPBLength             ds.w    1                ; offset: $6 (6)        ;  -> Length of the entire PB            
  382. scsiFunctionCode         ds.b    1                ; offset: $8 (8)        ;  -> function selector                 
  383. scsiReserved2             ds.b    1                ; offset: $9 (9)        ;  <-     reserved for output                
  384. scsiResult                 ds.w    1                ; offset: $A (10)        ;  <- Returned result                     
  385. scsiDevice                 ds        DeviceIdent        ; offset: $C (12)        ;  -> Device Identifier (bus+target+lun)
  386. scsiCompletion             ds.l    1                ; offset: $10 (16)        ;  -> Callback on completion function      
  387. scsiFlags                 ds.l    1                ; offset: $14 (20)        ;  -> assorted flags                    
  388. scsiDriverStorage         ds.l    1                ; offset: $18 (24)        ;  <> Ptr for driver private use        
  389. scsiXPTprivate             ds.l    1                ; offset: $1C (28)        ;  private field for use in XPT            
  390. scsiReserved3             ds.l    1                ; offset: $20 (32)        ;  reserved                                
  391. scsiResultFlags             ds.w    1                ; offset: $24 (36)        ;  <- Flags which modify the scsiResult field        
  392. scsiReserved3pt5         ds.w    1                ; offset: $26 (38)        ;  -> Reserved                                        
  393. scsiDataPtr                 ds.l    1                ; offset: $28 (40)        ;  -> Pointer to the data buffer or the S/G list      
  394. scsiDataLength             ds.l    1                ; offset: $2C (44)        ;  -> Data transfer length                            
  395. scsiSensePtr             ds.l    1                ; offset: $30 (48)        ;  -> Ptr to autosense data buffer                  
  396. scsiSenseLength             ds.b    1                ; offset: $34 (52)        ;  -> size of the autosense buffer                     
  397. scsiCDBLength             ds.b    1                ; offset: $35 (53)        ;  -> Number of bytes for the CDB                      
  398. scsiSGListCount             ds.w    1                ; offset: $36 (54)        ;  -> num of scatter gather list entries              
  399. scsiReserved4             ds.l    1                ; offset: $38 (56)        ;  <-     reserved for output                            
  400. scsiSCSIstatus             ds.b    1                ; offset: $3C (60)        ;  <- Returned scsi device status                      
  401. scsiSenseResidual         ds.b    1                ; offset: $3D (61)        ;  <- Autosense residual length                      
  402. scsiReserved5             ds.w    1                ; offset: $3E (62)        ;  <-     reserved for output                             
  403. scsiDataResidual         ds.l    1                ; offset: $40 (64)        ;  <- Returned Transfer residual length              
  404. scsiCDB                     ds        CDB                ; offset: $44 (68)        ;  -> Actual CDB or pointer to CDB                  
  405. scsiTimeout                 ds.l    1                ; offset: $54 (84)        ;  -> Timeout value (Time Mgr format) (CAM timeout) 
  406. scsiReserved5pt5         ds.l    1                ; offset: $58 (88)        ;  -> Reserved                                        
  407. scsiReserved5pt6         ds.w    1                ; offset: $5C (92)        ;  -> Reserved                                        
  408. scsiIOFlags                 ds.w    1                ; offset: $5E (94)        ;  -> additional I/O flags                               
  409. scsiTagAction             ds.b    1                ; offset: $60 (96)        ;  -> What to do for tag queuing                       
  410. scsiReserved6             ds.b    1                ; offset: $61 (97)        ;  ->     reserved for input                             
  411. scsiReserved7             ds.w    1                ; offset: $62 (98)        ;  ->     reserved for input                             
  412. scsiSelectTimeout         ds.w    1                ; offset: $64 (100)        ;  -> Select timeout value                             
  413. scsiDataType             ds.b    1                ; offset: $66 (102)        ;  -> Data description type (i.e. buffer, TIB, S/G)    
  414. scsiTransferType         ds.b    1                ; offset: $67 (103)        ;  -> Transfer type (i.e. Blind vs Polled)             
  415. scsiReserved8             ds.l    1                ; offset: $68 (104)        ;  ->     reserved for input                             
  416. scsiReserved9             ds.l    1                ; offset: $6C (108)        ;  ->     reserved for input                             
  417. scsiHandshake             ds.w    8                ; offset: $70 (112)        ;  -> handshaking points (null term'd)    
  418. scsiReserved10             ds.l    1                ; offset: $80 (128)        ;  ->     reserved for input                             
  419. scsiReserved11             ds.l    1                ; offset: $84 (132)        ;  ->   reserved for input                            
  420. scsiCommandLink             ds.l    1                ; offset: $88 (136)        ;  -> Ptr to the next PB in linked cmd chain         
  421. scsiSIMpublics             ds.b    8                ; offset: $8C (140)        ;  ->     reserved for input to 3rd-party SIMs        
  422. scsiAppleReserved6         ds.b    8                ; offset: $94 (148)        ;  ->    reserved for input                              
  423. ;  XPT layer privates (for old-API emulation) 
  424. scsiCurrentPhase         ds.w    1                ; offset: $9C (156)        ;  <- phase upon completing old call                  
  425. scsiSelector             ds.w    1                ; offset: $9E (158)        ;  -> selector specified in old calls                  
  426. scsiOldCallResult         ds.w    1                ; offset: $A0 (160)        ;  <- result of old call                              
  427. scsiSCSImessage             ds.b    1                ; offset: $A2 (162)        ;  <- Returned scsi device message (for SCSIComplete)
  428. XPTprivateFlags             ds.b    1                ; offset: $A3 (163)        ;  <> various flags                                   
  429. XPTextras                 ds.b    12                ; offset: $A4 (164)        ;                                                     
  430. sizeof                     EQU *                    ; size:   $B0 (176)
  431.                         ENDR
  432. SCSIExecIOPB            RECORD 0
  433. f                         ds        SCSI_IO
  434. sizeof                     EQU *                    ; size:   $B0 (176)
  435.                         ENDR
  436.  
  437.  
  438. ;  Bus inquiry PB 
  439. SCSIBusInquiryPB        RECORD 0
  440. qLink                     ds.l    1                ; offset: $0 (0)        ;  (internal use, must be nil on entry)    
  441. scsiReserved1             ds.w    1                ; offset: $4 (4)        ;  ->     reserved for input                
  442. scsiPBLength             ds.w    1                ; offset: $6 (6)        ;  -> Length of the entire PB            
  443. scsiFunctionCode         ds.b    1                ; offset: $8 (8)        ;  -> function selector                 
  444. scsiReserved2             ds.b    1                ; offset: $9 (9)        ;  <-     reserved for output                
  445. scsiResult                 ds.w    1                ; offset: $A (10)        ;  <- Returned result                     
  446. scsiDevice                 ds        DeviceIdent        ; offset: $C (12)        ;  -> Device Identifier (bus+target+lun)
  447. scsiCompletion             ds.l    1                ; offset: $10 (16)        ;  -> Callback on completion function      
  448. scsiFlags                 ds.l    1                ; offset: $14 (20)        ;  -> assorted flags                    
  449. scsiDriverStorage         ds.l    1                ; offset: $18 (24)        ;  <> Ptr for driver private use        
  450. scsiXPTprivate             ds.l    1                ; offset: $1C (28)        ;  private field for use in XPT            
  451. scsiReserved3             ds.l    1                ; offset: $20 (32)        ;  reserved                                
  452. scsiEngineCount             ds.w    1                ; offset: $24 (36)        ;  <- Number of engines on HBA                         
  453. scsiMaxTransferType         ds.w    1                ; offset: $26 (38)        ;  <- Number of transfer types for this HBA            
  454. scsiDataTypes             ds.l    1                ; offset: $28 (40)        ;  <- which data types are supported by this SIM     
  455. scsiIOpbSize             ds.w    1                ; offset: $2C (44)        ;  <- Size of SCSI_IO PB for this SIM/HBA             
  456. scsiMaxIOpbSize             ds.w    1                ; offset: $2E (46)        ;  <- Size of max SCSI_IO PB for all SIM/HBAs         
  457. scsiFeatureFlags         ds.l    1                ; offset: $30 (48)        ;  <- Supported features flags field                 
  458. scsiVersionNumber         ds.b    1                ; offset: $34 (52)        ;  <- Version number for the SIM/HBA                 
  459. scsiHBAInquiry             ds.b    1                ; offset: $35 (53)        ;  <- Mimic of INQ byte 7 for the HBA                 
  460. scsiTargetModeFlags         ds.b    1                ; offset: $36 (54)        ;  <- Flags for target mode support                 
  461. scsiScanFlags             ds.b    1                ; offset: $37 (55)        ;  <- Scan related feature flags                     
  462. scsiSIMPrivatesPtr         ds.l    1                ; offset: $38 (56)        ;  <- Ptr to SIM private data area                     
  463. scsiSIMPrivatesSize         ds.l    1                ; offset: $3C (60)        ;  <- Size of SIM private data area                 
  464. scsiAsyncFlags             ds.l    1                ; offset: $40 (64)        ;  <- Event cap. for Async Callback                 
  465. scsiHiBusID                 ds.b    1                ; offset: $44 (68)        ;  <- Highest path ID in the subsystem              
  466. scsiInitiatorID             ds.b    1                ; offset: $45 (69)        ;  <- ID of the HBA on the SCSI bus                 
  467. scsiBIReserved0             ds.w    1                ; offset: $46 (70)        ;                                                     
  468. scsiBIReserved1             ds.l    1                ; offset: $48 (72)        ;  <-                                                  
  469. scsiFlagsSupported         ds.l    1                ; offset: $4C (76)        ;  <- which scsiFlags are supported                 
  470. scsiIOFlagsSupported     ds.w    1                ; offset: $50 (80)        ;  <- which scsiIOFlags are supported                 
  471. scsiWeirdStuff             ds.w    1                ; offset: $52 (82)        ;  <-                                                 
  472. scsiMaxTarget             ds.w    1                ; offset: $54 (84)        ;  <- maximum Target number supported                 
  473. scsiMaxLUN                 ds.w    1                ; offset: $56 (86)        ;  <- maximum Logical Unit number supported         
  474. scsiSIMVendor             ds.b    16                ; offset: $58 (88)        ;  <- Vendor ID of SIM (or XPT if bus<FF)         
  475. scsiHBAVendor             ds.b    16                ; offset: $68 (104)        ;  <- Vendor ID of the HBA                         
  476. scsiControllerFamily     ds.b    16                ; offset: $78 (120)        ;  <- Family of SCSI Controller                 
  477. scsiControllerType         ds.b    16                ; offset: $88 (136)        ;  <- Specific Model of SCSI Controller used     
  478. scsiXPTversion             ds.b    4                ; offset: $98 (152)        ;  <- version number of XPT                         
  479. scsiSIMversion             ds.b    4                ; offset: $9C (156)        ;  <- version number of SIM                         
  480. scsiHBAversion             ds.b    4                ; offset: $A0 (160)        ;  <- version number of HBA                         
  481. scsiHBAslotType             ds.b    1                ; offset: $A4 (164)        ;  <- type of "slot" that this HBA is in            
  482. scsiHBAslotNumber         ds.b    1                ; offset: $A5 (165)        ;  <- slot number of this HBA                         
  483. scsiSIMsRsrcID             ds.w    1                ; offset: $A6 (166)        ;  <- resource ID of this SIM                         
  484. scsiBIReserved3             ds.w    1                ; offset: $A8 (168)        ;  <-                                                 
  485. scsiAdditionalLength     ds.w    1                ; offset: $AA (170)        ;  <- additional BusInquiry PB len                    
  486. sizeof                     EQU *                    ; size:   $AC (172)
  487.                         ENDR
  488. ;  Abort SIM Request PB 
  489. SCSIAbortCommandPB        RECORD 0
  490. qLink                     ds.l    1                ; offset: $0 (0)        ;  (internal use, must be nil on entry)    
  491. scsiReserved1             ds.w    1                ; offset: $4 (4)        ;  ->     reserved for input                
  492. scsiPBLength             ds.w    1                ; offset: $6 (6)        ;  -> Length of the entire PB            
  493. scsiFunctionCode         ds.b    1                ; offset: $8 (8)        ;  -> function selector                 
  494. scsiReserved2             ds.b    1                ; offset: $9 (9)        ;  <-     reserved for output                
  495. scsiResult                 ds.w    1                ; offset: $A (10)        ;  <- Returned result                     
  496. scsiDevice                 ds        DeviceIdent        ; offset: $C (12)        ;  -> Device Identifier (bus+target+lun)
  497. scsiCompletion             ds.l    1                ; offset: $10 (16)        ;  -> Callback on completion function      
  498. scsiFlags                 ds.l    1                ; offset: $14 (20)        ;  -> assorted flags                    
  499. scsiDriverStorage         ds.l    1                ; offset: $18 (24)        ;  <> Ptr for driver private use        
  500. scsiXPTprivate             ds.l    1                ; offset: $1C (28)        ;  private field for use in XPT            
  501. scsiReserved3             ds.l    1                ; offset: $20 (32)        ;  reserved                                
  502. scsiIOptr                 ds.l    1                ; offset: $24 (36)        ;  Pointer to the PB to abort            
  503. sizeof                     EQU *                    ; size:   $28 (40)
  504.                         ENDR
  505. ;  Terminate I/O Process Request PB 
  506. SCSITerminateIOPB        RECORD 0
  507. qLink                     ds.l    1                ; offset: $0 (0)        ;  (internal use, must be nil on entry)    
  508. scsiReserved1             ds.w    1                ; offset: $4 (4)        ;  ->     reserved for input                
  509. scsiPBLength             ds.w    1                ; offset: $6 (6)        ;  -> Length of the entire PB            
  510. scsiFunctionCode         ds.b    1                ; offset: $8 (8)        ;  -> function selector                 
  511. scsiReserved2             ds.b    1                ; offset: $9 (9)        ;  <-     reserved for output                
  512. scsiResult                 ds.w    1                ; offset: $A (10)        ;  <- Returned result                     
  513. scsiDevice                 ds        DeviceIdent        ; offset: $C (12)        ;  -> Device Identifier (bus+target+lun)
  514. scsiCompletion             ds.l    1                ; offset: $10 (16)        ;  -> Callback on completion function      
  515. scsiFlags                 ds.l    1                ; offset: $14 (20)        ;  -> assorted flags                    
  516. scsiDriverStorage         ds.l    1                ; offset: $18 (24)        ;  <> Ptr for driver private use        
  517. scsiXPTprivate             ds.l    1                ; offset: $1C (28)        ;  private field for use in XPT            
  518. scsiReserved3             ds.l    1                ; offset: $20 (32)        ;  reserved                                
  519. scsiIOptr                 ds.l    1                ; offset: $24 (36)        ;  Pointer to the PB to terminate         
  520. sizeof                     EQU *                    ; size:   $28 (40)
  521.                         ENDR
  522. ;  Reset SCSI Bus PB 
  523. SCSIResetBusPB            RECORD 0
  524. qLink                     ds.l    1                ; offset: $0 (0)        ;  (internal use, must be nil on entry)    
  525. scsiReserved1             ds.w    1                ; offset: $4 (4)        ;  ->     reserved for input                
  526. scsiPBLength             ds.w    1                ; offset: $6 (6)        ;  -> Length of the entire PB            
  527. scsiFunctionCode         ds.b    1                ; offset: $8 (8)        ;  -> function selector                 
  528. scsiReserved2             ds.b    1                ; offset: $9 (9)        ;  <-     reserved for output                
  529. scsiResult                 ds.w    1                ; offset: $A (10)        ;  <- Returned result                     
  530. scsiDevice                 ds        DeviceIdent        ; offset: $C (12)        ;  -> Device Identifier (bus+target+lun)
  531. scsiCompletion             ds.l    1                ; offset: $10 (16)        ;  -> Callback on completion function      
  532. scsiFlags                 ds.l    1                ; offset: $14 (20)        ;  -> assorted flags                    
  533. scsiDriverStorage         ds.l    1                ; offset: $18 (24)        ;  <> Ptr for driver private use        
  534. scsiXPTprivate             ds.l    1                ; offset: $1C (28)        ;  private field for use in XPT            
  535. scsiReserved3             ds.l    1                ; offset: $20 (32)        ;  reserved                                
  536. sizeof                     EQU *                    ; size:   $24 (36)
  537.                         ENDR
  538. ;  Reset SCSI Device PB 
  539. SCSIResetDevicePB        RECORD 0
  540. qLink                     ds.l    1                ; offset: $0 (0)        ;  (internal use, must be nil on entry)    
  541. scsiReserved1             ds.w    1                ; offset: $4 (4)        ;  ->     reserved for input                
  542. scsiPBLength             ds.w    1                ; offset: $6 (6)        ;  -> Length of the entire PB            
  543. scsiFunctionCode         ds.b    1                ; offset: $8 (8)        ;  -> function selector                 
  544. scsiReserved2             ds.b    1                ; offset: $9 (9)        ;  <-     reserved for output                
  545. scsiResult                 ds.w    1                ; offset: $A (10)        ;  <- Returned result                     
  546. scsiDevice                 ds        DeviceIdent        ; offset: $C (12)        ;  -> Device Identifier (bus+target+lun)
  547. scsiCompletion             ds.l    1                ; offset: $10 (16)        ;  -> Callback on completion function      
  548. scsiFlags                 ds.l    1                ; offset: $14 (20)        ;  -> assorted flags                    
  549. scsiDriverStorage         ds.l    1                ; offset: $18 (24)        ;  <> Ptr for driver private use        
  550. scsiXPTprivate             ds.l    1                ; offset: $1C (28)        ;  private field for use in XPT            
  551. scsiReserved3             ds.l    1                ; offset: $20 (32)        ;  reserved                                
  552. sizeof                     EQU *                    ; size:   $24 (36)
  553.                         ENDR
  554. ;  Release SIM Queue PB 
  555. SCSIReleaseQPB            RECORD 0
  556. qLink                     ds.l    1                ; offset: $0 (0)        ;  (internal use, must be nil on entry)    
  557. scsiReserved1             ds.w    1                ; offset: $4 (4)        ;  ->     reserved for input                
  558. scsiPBLength             ds.w    1                ; offset: $6 (6)        ;  -> Length of the entire PB            
  559. scsiFunctionCode         ds.b    1                ; offset: $8 (8)        ;  -> function selector                 
  560. scsiReserved2             ds.b    1                ; offset: $9 (9)        ;  <-     reserved for output                
  561. scsiResult                 ds.w    1                ; offset: $A (10)        ;  <- Returned result                     
  562. scsiDevice                 ds        DeviceIdent        ; offset: $C (12)        ;  -> Device Identifier (bus+target+lun)
  563. scsiCompletion             ds.l    1                ; offset: $10 (16)        ;  -> Callback on completion function      
  564. scsiFlags                 ds.l    1                ; offset: $14 (20)        ;  -> assorted flags                    
  565. scsiDriverStorage         ds.l    1                ; offset: $18 (24)        ;  <> Ptr for driver private use        
  566. scsiXPTprivate             ds.l    1                ; offset: $1C (28)        ;  private field for use in XPT            
  567. scsiReserved3             ds.l    1                ; offset: $20 (32)        ;  reserved                                
  568. sizeof                     EQU *                    ; size:   $24 (36)
  569.                         ENDR
  570. ;  SCSI Get Virtual ID Info PB 
  571. SCSIGetVirtualIDInfoPB    RECORD 0
  572. qLink                     ds.l    1                ; offset: $0 (0)        ;  (internal use, must be nil on entry)    
  573. scsiReserved1             ds.w    1                ; offset: $4 (4)        ;  ->     reserved for input                
  574. scsiPBLength             ds.w    1                ; offset: $6 (6)        ;  -> Length of the entire PB            
  575. scsiFunctionCode         ds.b    1                ; offset: $8 (8)        ;  -> function selector                 
  576. scsiReserved2             ds.b    1                ; offset: $9 (9)        ;  <-     reserved for output                
  577. scsiResult                 ds.w    1                ; offset: $A (10)        ;  <- Returned result                     
  578. scsiDevice                 ds        DeviceIdent        ; offset: $C (12)        ;  -> Device Identifier (bus+target+lun)
  579. scsiCompletion             ds.l    1                ; offset: $10 (16)        ;  -> Callback on completion function      
  580. scsiFlags                 ds.l    1                ; offset: $14 (20)        ;  -> assorted flags                    
  581. scsiDriverStorage         ds.l    1                ; offset: $18 (24)        ;  <> Ptr for driver private use        
  582. scsiXPTprivate             ds.l    1                ; offset: $1C (28)        ;  private field for use in XPT            
  583. scsiReserved3             ds.l    1                ; offset: $20 (32)        ;  reserved                                
  584. scsiOldCallID             ds.w    1                ; offset: $24 (36)        ;  -> SCSI ID of device in question     
  585. scsiExists                 ds.b    1                ; offset: $26 (38)        ;  <- true if device exists             
  586. filler                     ds.b    1                ; offset: $27 (39)
  587. sizeof                     EQU *                    ; size:   $28 (40)
  588.                         ENDR
  589. ;  Create/Lookup/Remove RefNum for Device PB 
  590. SCSIDriverPB            RECORD 0
  591. qLink                     ds.l    1                ; offset: $0 (0)        ;  (internal use, must be nil on entry)    
  592. scsiReserved1             ds.w    1                ; offset: $4 (4)        ;  ->     reserved for input                
  593. scsiPBLength             ds.w    1                ; offset: $6 (6)        ;  -> Length of the entire PB            
  594. scsiFunctionCode         ds.b    1                ; offset: $8 (8)        ;  -> function selector                 
  595. scsiReserved2             ds.b    1                ; offset: $9 (9)        ;  <-     reserved for output                
  596. scsiResult                 ds.w    1                ; offset: $A (10)        ;  <- Returned result                     
  597. scsiDevice                 ds        DeviceIdent        ; offset: $C (12)        ;  -> Device Identifier (bus+target+lun)
  598. scsiCompletion             ds.l    1                ; offset: $10 (16)        ;  -> Callback on completion function      
  599. scsiFlags                 ds.l    1                ; offset: $14 (20)        ;  -> assorted flags                    
  600. scsiDriverStorage         ds.l    1                ; offset: $18 (24)        ;  <> Ptr for driver private use        
  601. scsiXPTprivate             ds.l    1                ; offset: $1C (28)        ;  private field for use in XPT            
  602. scsiReserved3             ds.l    1                ; offset: $20 (32)        ;  reserved                                
  603. scsiDriver                 ds.w    1                ; offset: $24 (36)        ;  -> DriverRefNum, For SetDriver, <- For GetNextDriver 
  604. scsiDriverFlags             ds.w    1                ; offset: $26 (38)        ;  <> Details of driver/device             
  605. scsiNextDevice             ds        DeviceIdent        ; offset: $28 (40)        ;  <- DeviceIdent of the NEXT Item in the list  
  606. sizeof                     EQU *                    ; size:   $2C (44)
  607.                         ENDR
  608. ;  Load Driver PB 
  609. SCSILoadDriverPB        RECORD 0
  610. qLink                     ds.l    1                ; offset: $0 (0)        ;  (internal use, must be nil on entry)    
  611. scsiReserved1             ds.w    1                ; offset: $4 (4)        ;  ->     reserved for input                
  612. scsiPBLength             ds.w    1                ; offset: $6 (6)        ;  -> Length of the entire PB            
  613. scsiFunctionCode         ds.b    1                ; offset: $8 (8)        ;  -> function selector                 
  614. scsiReserved2             ds.b    1                ; offset: $9 (9)        ;  <-     reserved for output                
  615. scsiResult                 ds.w    1                ; offset: $A (10)        ;  <- Returned result                     
  616. scsiDevice                 ds        DeviceIdent        ; offset: $C (12)        ;  -> Device Identifier (bus+target+lun)
  617. scsiCompletion             ds.l    1                ; offset: $10 (16)        ;  -> Callback on completion function      
  618. scsiFlags                 ds.l    1                ; offset: $14 (20)        ;  -> assorted flags                    
  619. scsiDriverStorage         ds.l    1                ; offset: $18 (24)        ;  <> Ptr for driver private use        
  620. scsiXPTprivate             ds.l    1                ; offset: $1C (28)        ;  private field for use in XPT            
  621. scsiReserved3             ds.l    1                ; offset: $20 (32)        ;  reserved                                
  622. scsiLoadedRefNum         ds.w    1                ; offset: $24 (36)        ;  <- SIM returns refnum of driver         
  623. scsiDiskLoadFailed         ds.b    1                ; offset: $26 (38)        ;  -> if true, indicates call after failure to load 
  624. filler                     ds.b    1                ; offset: $27 (39)
  625. sizeof                     EQU *                    ; size:   $28 (40)
  626.                         ENDR
  627.  
  628. ;  Defines for the scsiTransferType field 
  629.  
  630. scsiTransferBlind                EQU        0
  631. scsiTransferPolled                EQU        1
  632.  
  633. scsiErrorBase                    EQU        -7936
  634.  
  635. scsiRequestInProgress            EQU        1                    ; 1     = PB request is in progress             
  636.                                                             ; Execution failed  00-2F 
  637. scsiRequestAborted                EQU        -7934                ; -7934 = PB request aborted by the host         
  638. scsiUnableToAbort                EQU        -7933                ; -7933 = Unable to Abort PB request             
  639. scsiNonZeroStatus                EQU        -7932                ; -7932 = PB request completed with an err     
  640. scsiUnused05                    EQU        -7931                ; -7931 =                                      
  641. scsiUnused06                    EQU        -7930                ; -7930 =                                      
  642. scsiUnused07                    EQU        -7929                ; -7929 =                                      
  643. scsiUnused08                    EQU        -7928                ; -7928 =                                      
  644. scsiUnableToTerminate            EQU        -7927                ; -7927 = Unable to Terminate I/O PB req         
  645. scsiSelectTimeout                EQU        -7926                ; -7926 = Target selection timeout             
  646. scsiCommandTimeout                EQU        -7925                ; -7925 = Command timeout                      
  647. scsiIdentifyMessageRejected        EQU        -7924                ; -7924 =                                      
  648. scsiMessageRejectReceived        EQU        -7923                ; -7923 = Message reject received                 
  649. scsiSCSIBusReset                EQU        -7922                ; -7922 = SCSI bus reset sent/received         
  650. scsiParityError                    EQU        -7921                ; -7921 = Uncorrectable parity error occured     
  651. scsiAutosenseFailed                EQU        -7920                ; -7920 = Autosense: Request sense cmd fail     
  652. scsiUnused11                    EQU        -7919                ; -7919 =                                      
  653. scsiDataRunError                EQU        -7918                ; -7918 = Data overrun/underrun error          
  654. scsiUnexpectedBusFree            EQU        -7917                ; -7917 = Unexpected BUS free                     
  655. scsiSequenceFailed                EQU        -7916                ; -7916 = Target bus phase sequence failure     
  656. scsiWrongDirection                EQU        -7915                ; -7915 = Data phase was in wrong direction     
  657. scsiUnused16                    EQU        -7914                ; -7914 =                                      
  658. scsiBDRsent                        EQU        -7913                ; -7913 = A SCSI BDR msg was sent to target     
  659. scsiTerminated                    EQU        -7912                ; -7912 = PB request terminated by the host     
  660. scsiNoNexus                        EQU        -7911                ; -7911 = Nexus is not established             
  661. scsiCDBReceived                    EQU        -7910                ; -7910 = The SCSI CDB has been received         
  662.                                                             ; Couldn't begin execution  30-3F 
  663. scsiTooManyBuses                EQU        -7888                ; -7888 = Register failed because we're full    
  664. scsiBusy                        EQU        -7887                ; -7887 = SCSI subsystem is busy                 
  665. scsiProvideFail                    EQU        -7886                ; -7886 = Unable to provide requ. capability    
  666. scsiDeviceNotThere                EQU        -7885                ; -7885 = SCSI device not installed/there      
  667. scsiNoHBA                        EQU        -7884                ; -7884 = No HBA detected Error                 
  668. scsiDeviceConflict                EQU        -7883                ; -7883 = sorry, max 1 refNum per DeviceIdent     
  669. scsiNoSuchXref                    EQU        -7882                ; -7882 = no such RefNum xref                     
  670. scsiQLinkInvalid                EQU        -7881                ; -7881 = pre-linked PBs not supported            
  671.                                                             ;   (The QLink field was nonzero)                
  672.                                                             ; Parameter errors  40-7F 
  673. scsiPBLengthError                EQU        -7872                ; -7872 = (scsiPBLength is insuf'ct/invalid     
  674. scsiFunctionNotAvailable        EQU        -7871                ; -7871 = The requ. func is not available      
  675. scsiRequestInvalid                EQU        -7870                ; -7870 = PB request is invalid                 
  676. scsiBusInvalid                    EQU        -7869                ; -7869 = Bus ID supplied is invalid              
  677. scsiTIDInvalid                    EQU        -7868                ; -7868 = Target ID supplied is invalid         
  678. scsiLUNInvalid                    EQU        -7867                ; -7867 = LUN supplied is invalid              
  679. scsiIDInvalid                    EQU        -7866                ; -7866 = The initiator ID is invalid          
  680. scsiDataTypeInvalid                EQU        -7865                ; -7865 = scsiDataType requested not supported 
  681. scsiTransferTypeInvalid            EQU        -7864                ; -7864 = scsiTransferType field is too high     
  682. scsiCDBLengthInvalid            EQU        -7863                ; -7863 = scsiCDBLength field is too big         
  683. ;  New errors for SCSI Family         
  684.  
  685. scsiUnused74                    EQU        -7862                ; -7862 =                                          
  686. scsiUnused75                    EQU        -7861                ; -7861 =                                         
  687. scsiBadDataLength                EQU        -7860                ; -7860 = a zero data length in PB             
  688. scsiPartialPrepared                EQU        -7859                ; -7859 = could not do full prepare mem for I/O
  689. scsiInvalidMsgType                EQU        -7858                ; -7858 = Invalid message type (internal)        
  690. scsiUnused79                    EQU        -7857                ; -7857 =                                           
  691. scsiBadConnID                    EQU        -7856                ; -7856 = Bad Connection ID                      
  692. scsiUnused81                    EQU        -7855                ; -7855 =                                         
  693. scsiIOInProgress                EQU        -7854                ; -7854 = Can't close conn, IO in prog            
  694. scsiTargetReserved                EQU        -7853                ; -7853 = Target already reserved                
  695. scsiUnused84                    EQU        -7852                ; -7852 =                                         
  696. scsiUnused85                    EQU        -7851                ; -7851 =                                         
  697. scsiBadConnType                    EQU        -7850                ; -7850 = Bad connection type                    
  698. scsiCannotLoadPlugin            EQU        -7849                ; -7849 = No matching service category            
  699. ;  +++ 
  700. ; * scsiFamilyInternalError and scsiPluginInternalError are intended to handle consistency check failures.
  701. ; * For example, if the family stores a record on a lookaside queue, but does not find that record
  702. ; * it can use this error to report this failure. SCSI Manager 4.3 uses dsIOCoreErr in a few places,
  703. ; * but this is probably not the best error. In general, internal errors should be reported as bugs.
  704. ; *
  705. ; * The following range of errors is provided for third-party (non-Apple) SCSI SIM and device driver vendors.
  706. ; * In general, they would be used for error conditions that are not covered by the standardized errors.
  707. ; * They should not normally be conveyed to normal applications, but might be used for communication between
  708. ; * a plug-in and a vendor-provided device driver (for example, to manage RAID hot-swapping).
  709. ; *
  710. ; * Note: I don't know how many SCSI errors are reserved in the error code architecture. Don't assume that
  711. ; * we'll actually get sixteen, but we should reserve at least one.
  712.  
  713.  
  714. scsiFamilyInternalError            EQU        -7849                ; -7849 = Internal consistency check failed    
  715. scsiPluginInternalError            EQU        -7848                ; -7848 = Internal consistency check failed    
  716. scsiVendorSpecificErrorBase        EQU        -7808                ; ??    = Start of third-party error range        
  717. scsiVendorSpecificErrorCount    EQU        16                    ; Number of third-party errors                    
  718. ;  --- 
  719.  
  720. scsiExecutionErrors                EQU        -7936
  721. scsiNotExecutedErrors            EQU        -7888
  722. scsiParameterErrors                EQU        -7872
  723. ;  Defines for the scsiResultFlags field 
  724.  
  725. scsiSIMQFrozen                    EQU        $0001                ; The SIM queue is frozen w/this err            
  726. scsiAutosenseValid                EQU        $0002                ; Autosense data valid for target              
  727. scsiBusNotFree                    EQU        $0004                ; At time of callback, SCSI bus is not free    
  728. ;  Defines for the bit numbers of the scsiFlags field in the PB header for the SCSIExecIO function 
  729.  
  730. kbSCSIDisableAutosense            EQU        29                    ; Disable auto sense feature                     
  731. kbSCSIFlagReservedA                EQU        28                    ;                                              
  732. kbSCSIFlagReserved0                EQU        27                    ;                                              
  733. kbSCSICDBLinked                    EQU        26                    ; The PB contains a linked CDB                    
  734. kbSCSIQEnable                    EQU        25                    ; Target queue actions are enabled                
  735. kbSCSICDBIsPointer                EQU        24                    ; The CDB field contains a pointer                
  736. kbSCSIFlagReserved1                EQU        23                    ;                                                 
  737. kbSCSIInitiateSyncData            EQU        22                    ; Attempt Sync data xfer and SDTR                
  738. kbSCSIDisableSyncData            EQU        21                    ; Disable sync, go to async                    
  739. kbSCSISIMQHead                    EQU        20                    ; Place PB at the head of SIM Q                
  740. kbSCSISIMQFreeze                EQU        19                    ; Return the SIM Q to frozen state                
  741. kbSCSISIMQNoFreeze                EQU        18                    ; Disallow SIM Q freezing                        
  742. kbSCSIDoDisconnect                EQU        17                    ; Definitely do disconnect                        
  743. kbSCSIDontDisconnect            EQU        16                    ; Definitely don't disconnect                    
  744. kbSCSIDataReadyForDMA            EQU        15                    ; Data buffer(s) are ready for DMA                
  745. kbSCSIFlagReserved3                EQU        14                    ;                                                 
  746. kbSCSIDataPhysical                EQU        13                    ; SG/Buffer data ptrs are physical                
  747. kbSCSISensePhysical                EQU        12                    ; Autosense buffer ptr is physical                
  748. kbSCSIFlagReserved5                EQU        11                    ;                                                 
  749. kbSCSIFlagReserved6                EQU        10                    ;                                                 
  750. kbSCSIFlagReserved7                EQU        9                    ;                                                 
  751. kbSCSIFlagReserved8                EQU        8                    ;                                                 
  752. kbSCSIDataBufferValid            EQU        7                    ; Data buffer valid                            
  753. kbSCSIStatusBufferValid            EQU        6                    ; Status buffer valid                             
  754. kbSCSIMessageBufferValid        EQU        5                    ; Message buffer valid                            
  755. kbSCSIFlagReserved9                EQU        4                    ;                                              
  756. ;  Defines for the bit masks of the scsiFlags field 
  757.  
  758. scsiDirectionMask                EQU        $C0000000            ; Data direction mask                        
  759. scsiDirectionNone                EQU        $C0000000            ; Data direction (11: no data)                
  760. scsiDirectionReserved            EQU        $00000000            ; Data direction (00: reserved)            
  761. scsiDirectionOut                EQU        $80000000            ; Data direction (10: DATA OUT)            
  762. scsiDirectionIn                    EQU        $40000000            ; Data direction (01: DATA IN)                
  763. scsiDisableAutosense            EQU        $20000000            ; Disable auto sense feature                
  764. scsiFlagReservedA                EQU        $10000000            ;                                             
  765. scsiFlagReserved0                EQU        $08000000            ;                                             
  766. scsiCDBLinked                    EQU        $04000000            ; The PB contains a linked CDB                
  767. scsiQEnable                        EQU        $02000000            ; Target queue actions are enabled            
  768. scsiCDBIsPointer                EQU        $01000000            ; The CDB field contains a pointer            
  769. scsiFlagReserved1                EQU        $00800000            ;                                             
  770. scsiInitiateSyncData            EQU        $00400000            ; Attempt Sync data xfer and SDTR            
  771. scsiDisableSyncData                EQU        $00200000            ; Disable sync, go to async                
  772. scsiSIMQHead                    EQU        $00100000            ; Place PB at the head of SIM Q            
  773. scsiSIMQFreeze                    EQU        $00080000            ; Return the SIM Q to frozen state            
  774. scsiSIMQNoFreeze                EQU        $00040000            ; Disallow SIM Q freezing                    
  775. scsiDoDisconnect                EQU        $00020000            ; Definitely do disconnect                    
  776. scsiDontDisconnect                EQU        $00010000            ; Definitely don't disconnect                
  777. scsiDataReadyForDMA                EQU        $00008000            ; Data buffer(s) are ready for DMA            
  778. scsiFlagReserved3                EQU        $00004000            ;  
  779. scsiDataPhysical                EQU        $00002000            ; SG/Buffer data ptrs are physical            
  780. scsiSensePhysical                EQU        $00001000            ; Autosense buffer ptr is physical            
  781. scsiFlagReserved5                EQU        $00000800            ;                                          
  782. scsiFlagReserved6                EQU        $00000400            ;                                             
  783. scsiFlagReserved7                EQU        $00000200            ;                                             
  784. scsiFlagReserved8                EQU        $00000100            ;                                             
  785. ;  bit masks for the scsiIOFlags field in SCSIExecIOPB 
  786.  
  787. scsiNoParityCheck                EQU        $0002                ; disable parity checking                             
  788. scsiDisableSelectWAtn            EQU        $0004                ; disable select w/Atn                              
  789. scsiSavePtrOnDisconnect            EQU        $0008                ; do SaveDataPointer upon Disconnect msg             
  790. scsiNoBucketIn                    EQU        $0010                ; don’t bit bucket in during this I/O                 
  791. scsiNoBucketOut                    EQU        $0020                ; don’t bit bucket out during this I/O             
  792. scsiDisableWide                    EQU        $0040                ; disable wide transfer negotiation                 
  793. scsiInitiateWide                EQU        $0080                ; initiate wide transfer negotiation                 
  794. scsiRenegotiateSense            EQU        $0100                ; renegotiate sync/wide before issuing autosense     
  795. scsiDisableDiscipline            EQU        $0200                ; disable parameter checking on SCSIExecIO calls    
  796. scsiIOFlagReserved0080            EQU        $0080                ;                                                  
  797. scsiIOFlagReserved8000            EQU        $8000                ;                                                     
  798. ;  Defines for the Bus Inquiry PB fields. 
  799. ;  scsiHBAInquiry field bits 
  800.  
  801. scsiBusMDP                        EQU        $80                    ; Supports Modify Data Pointer message                        
  802. scsiBusWide32                    EQU        $40                    ; Supports 32 bit wide SCSI                                
  803. scsiBusWide16                    EQU        $20                    ; Supports 16 bit wide SCSI                                
  804. scsiBusSDTR                        EQU        $10                    ; Supports Sync Data Transfer Req message                    
  805. scsiBusLinkedCDB                EQU        $08                    ; Supports linked CDBs                                        
  806. scsiBusTagQ                        EQU        $02                    ; Supports tag queue message                                
  807. scsiBusSoftReset                EQU        $01                    ; Supports soft reset                                        
  808. ;  Defines for the scsiDataType field 
  809.  
  810. scsiDataBuffer                    EQU        0                    ; single contiguous buffer supplied                  
  811. scsiDataTIB                        EQU        1                    ; TIB supplied (ptr in scsiDataPtr)                 
  812. scsiDataSG                        EQU        2                    ; scatter/gather list supplied                      
  813. scsiDataIOTable                    EQU        3                    ;#(7/11/95) Prepared by Block Storage              
  814. ;  scsiDataTypes field bits  
  815. ;     bits 0->15 Apple-defined, 16->30 3rd-party unique, 31 = reserved 
  816.  
  817. scsiBusDataTIB                    EQU        $02                    ; TIB supplied (ptr in scsiDataPtr)        
  818. scsiBusDataBuffer                EQU        $01                    ; single contiguous buffer supplied         
  819. scsiBusDataSG                    EQU        $04                    ; scatter/gather list supplied             
  820. scsiBusDataIOTable                EQU        $08                    ; (2/6/95) Prepare Memory for IO
  821. scsiBusDataReserved                EQU        $80000000            ;                                           
  822. ;  scsiScanFlags field bits 
  823.  
  824. scsiBusScansDevices                EQU        $80                    ; Bus scans for and maintains device list            
  825. scsiBusScansOnInit                EQU        $40                    ; Bus scans performed at power-up/reboot            
  826. scsiBusLoadsROMDrivers            EQU        $20                    ; may load ROM drivers to support targets             
  827. ;  scsiFeatureFlags field bits 
  828.  
  829. scsiBusLVD                        EQU        $00000400            ; HBA is Low Voltage Differential Bus            
  830. scsiBusUltra3SCSI                EQU        $00000200            ; HBA supports Ultra3 SCSI                        
  831. scsiBusUltra2SCSI                EQU        $00000100            ; HBA supports Ultra2 SCSI                        
  832. scsiBusInternalExternalMask        EQU        $000000C0            ; bus internal/external mask                    
  833. scsiBusInternalExternalUnknown    EQU        $00000000            ; not known whether bus is inside or outside     
  834. scsiBusInternalExternal            EQU        $000000C0            ; bus goes inside and outside the box             
  835. scsiBusInternal                    EQU        $00000080            ; bus goes inside the box                         
  836. scsiBusExternal                    EQU        $00000040            ; bus goes outside the box                     
  837. scsiBusCacheCoherentDMA            EQU        $00000020            ; DMA is cache coherent                         
  838. scsiBusOldCallCapable            EQU        $00000010            ; SIM is old call capable                         
  839. scsiBusUltraSCSI                EQU        $00000008            ; HBA supports Ultra SCSI                        
  840. scsiBusDifferential                EQU        $00000004            ; Single Ended (0) or Differential (1)         
  841. scsiBusFastSCSI                    EQU        $00000002            ; HBA supports fast SCSI                         
  842. scsiBusDMAavailable                EQU        $00000001            ; DMA is available                             
  843. ;  scsiWeirdStuff field bits 
  844.  
  845. scsiOddDisconnectUnsafeRead1    EQU        $0001                ; Disconnects on odd byte boundries are unsafe with DMA and/or blind reads 
  846. scsiOddDisconnectUnsafeWrite1    EQU        $0002                ; Disconnects on odd byte boundries are unsafe with DMA and/or blind writes 
  847. scsiBusErrorsUnsafe                EQU        $0004                ; Non-handshaked delays or disconnects during blind transfers may cause a crash 
  848. scsiRequiresHandshake            EQU        $0008                ; Non-handshaked delays or disconnects during blind transfers may cause data corruption 
  849. scsiTargetDrivenSDTRSafe        EQU        $0010                ; Targets which initiate synchronous negotiations are supported 
  850. scsiOddCountForPhysicalUnsafe    EQU        $0020                ; If using physical addrs all counts must be even, and disconnects must be on even boundries 
  851. scsiAbortCmdFixed                EQU        $0040                ; Set if abort command is fixed to properly make callbacks 
  852. scsiMeshACKTimingFixed            EQU        $0080                ; Set if bug allowing Mesh to release ACK prematurely is fixed 
  853. ;  scsiHBAslotType values 
  854.  
  855. scsiMotherboardBus                EQU        $00                    ; A built in Apple supplied bus                     
  856. scsiNuBus                        EQU        $01                    ; A SIM on a NuBus card                             
  857. scsiPDSBus                        EQU        $03                    ;    "  on a PDS card                                
  858. scsiPCIBus                        EQU        $04                    ;    "  on a PCI bus card                            
  859. scsiPCMCIABus                    EQU        $05                    ;    "  on a PCMCIA card                            
  860. scsiFireWireBridgeBus            EQU        $06                    ;    "  connected through a FireWire bridge        
  861. ;  Defines for the scsiDriverFlags field (in SCSIDriverPB) 
  862.  
  863. scsiDeviceSensitive                EQU        $0001                ; Only driver should access this device                
  864. scsiDeviceNoOldCallAccess        EQU        $0002                ; no old call access to this device                     
  865. ;   SIMInitInfo PB 
  866. ;  directions are for SCSIRegisterBus call ( -> parm, <- result)             
  867. SIMInitInfo                RECORD 0
  868. SIMstaticPtr             ds.l    1                ; offset: $0 (0)        ;  <- alloc. ptr to the SIM's static vars                 
  869. staticSize                 ds.l    1                ; offset: $4 (4)        ;  -> num bytes SIM needs for static vars                 
  870. SIMInit                     ds.l    1                ; offset: $8 (8)        ;  -> pointer to the SIM init routine                     
  871. SIMAction                 ds.l    1                ; offset: $C (12)        ;  -> pointer to the SIM action routine                 
  872. SIM_ISR                     ds.l    1                ; offset: $10 (16)        ;        reserved                                             
  873. SIMInterruptPoll         ds.l    1                ; offset: $14 (20)        ;  -> pointer to the SIM interrupt poll routine            
  874. NewOldCall                 ds.l    1                ; offset: $18 (24)        ;  -> pointer to the SIM NewOldCall routine                
  875. ioPBSize                 ds.w    1                ; offset: $1C (28)        ;  -> size of SCSI_IO_PBs required for this SIM            
  876. oldCallCapable             ds.b    1                ; offset: $1E (30)        ;  -> true if this SIM can handle old-API calls            
  877. simInfoUnused1             ds.b    1                ; offset: $1F (31)        ;        reserved                                            
  878. simInternalUse             ds.l    1                ; offset: $20 (32)        ;  xx not affected or viewed by XPT                        
  879. XPT_ISR                     ds.l    1                ; offset: $24 (36)        ;     reserved                                            
  880. EnteringSIM                 ds.l    1                ; offset: $28 (40)        ;  <- ptr to the EnteringSIM routine                    
  881. ExitingSIM                 ds.l    1                ; offset: $2C (44)        ;  <- ptr to the ExitingSIM routine                        
  882. MakeCallback             ds.l    1                ; offset: $30 (48)        ;  <- the XPT layer’s SCSIMakeCallback routine            
  883. busID                     ds.w    1                ; offset: $34 (52)        ;  <- bus number for the registered bus                    
  884. simSlotNumber             ds.b    1                ; offset: $36 (54)        ;  <- Magic cookie to place in scsiHBASlotNumber (PCI)    
  885. simSRsrcID                 ds.b    1                ; offset: $37 (55)        ;  <- Magic cookie to place in scsiSIMsRsrcID     (PCI)    
  886. simRegEntry                 ds.l    1                ; offset: $38 (56)        ;  -> The SIM's RegEntryIDPtr                     (PCI)    
  887. sizeof                     EQU *                    ; size:   $3C (60)
  888.                         ENDR
  889. ;  Glue between SCSI calls and SCSITrap format 
  890.  
  891. xptSCSIAction                    EQU        $0001
  892. xptSCSIRegisterBus                EQU        $0002
  893. xptSCSIDeregisterBus            EQU        $0003
  894. xptSCSIReregisterBus            EQU        $0004
  895. xptSCSIKillXPT                    EQU        $0005                ; kills Mini-XPT after transition 
  896. xptSCSIInitialize                EQU        $000A                ; Initialize the SCSI manager 
  897. ; * SCSI bus status. These values are returned by the SCSI target in the status phase.
  898. ; * They are not related to Macintosh status values (except that values other than
  899. ; * scsiStatusGood will result in scsiResult set to scsiNonZeroStatus).
  900.  
  901.  
  902. scsiStatGood                    EQU        $00                    ; Good Status
  903. scsiStatCheckCondition            EQU        $02                    ; Check Condition
  904. scsiStatConditionMet            EQU        $04                    ; Condition Met
  905. scsiStatBusy                    EQU        $08                    ; Busy
  906. scsiStatIntermediate            EQU        $10                    ; Intermediate
  907. scsiStatIntermedMet                EQU        $14                    ; Intermediate - Condition Met
  908. scsiStatResvConflict            EQU        $18                    ; Reservation conflict
  909. scsiStatTerminated                EQU        $22                    ; Command terminated
  910. scsiStatQFull                    EQU        $28                    ; Queue full
  911. ;  SCSI messages
  912.  
  913. kCmdCompleteMsg                    EQU        0
  914. kExtendedMsg                    EQU        1                    ; 0x01
  915. kSaveDataPointerMsg                EQU        2                    ; 0x02
  916. kRestorePointersMsg                EQU        3                    ; 0x03
  917. kDisconnectMsg                    EQU        4                    ; 0x04
  918. kInitiatorDetectedErrorMsg        EQU        5                    ; 0x05
  919. kAbortMsg                        EQU        6                    ; 0x06
  920. kMsgRejectMsg                    EQU        7                    ; 0x07
  921. kNoOperationMsg                    EQU        8                    ; 0x08
  922. kMsgParityErrorMsg                EQU        9                    ; 0x09
  923. kLinkedCmdCompleteMsg            EQU        10                    ; 0x0a
  924. kLinkedCmdCompleteWithFlagMsg    EQU        11                    ; 0x0b
  925. kBusDeviceResetMsg                EQU        12                    ; 0x0c
  926. kAbortTagMsg                    EQU        13                    ; 0x0d
  927. kClearQueueMsg                    EQU        14                    ; 0x0e
  928. kInitiateRecoveryMsg            EQU        15                    ; 0x0f
  929. kReleaseRecoveryMsg                EQU        16                    ; 0x10
  930. kTerminateIOProcessMsg            EQU        17                    ; 0x11
  931. kSimpleQueueTag                    EQU        $20                    ; 0x20
  932. kHeadOfQueueTagMsg                EQU        $21                    ; 0x21
  933. kOrderedQueueTagMsg                EQU        $22                    ; 0x22
  934. kIgnoreWideResidueMsg            EQU        $23                    ; 0x23
  935.  
  936. ;  moveq #kSCSIx, D0;  _SCSIAtomic 
  937. ;
  938. ; pascal OSErr SCSIAction(SCSI_PB *parameterBlock)
  939. ;
  940.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  941.         ; parameters:
  942.         ;    parameterBlock  => A0
  943.         ; returns:
  944.         ;    OSErr           <= D0
  945.         Macro
  946.         _SCSIAction
  947.             moveq               #1,D0
  948.             dc.w                $A089
  949.         EndM
  950.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  951.         IMPORT_CFM_FUNCTION SCSIAction
  952.     ENDIF
  953.  
  954. ;
  955. ; pascal OSErr SCSIRegisterBus(SIMInitInfo *parameterBlock)
  956. ;
  957.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  958.         ; parameters:
  959.         ;    parameterBlock  => A0
  960.         ; returns:
  961.         ;    OSErr           <= D0
  962.         Macro
  963.         _SCSIRegisterBus
  964.             moveq               #2,D0
  965.             dc.w                $A089
  966.         EndM
  967.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  968.         IMPORT_CFM_FUNCTION SCSIRegisterBus
  969.     ENDIF
  970.  
  971. ;
  972. ; pascal OSErr SCSIDeregisterBus(SCSI_PB *parameterBlock)
  973. ;
  974.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  975.         ; parameters:
  976.         ;    parameterBlock  => A0
  977.         ; returns:
  978.         ;    OSErr           <= D0
  979.         Macro
  980.         _SCSIDeregisterBus
  981.             moveq               #3,D0
  982.             dc.w                $A089
  983.         EndM
  984.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  985.         IMPORT_CFM_FUNCTION SCSIDeregisterBus
  986.     ENDIF
  987.  
  988. ;
  989. ; pascal OSErr SCSIReregisterBus(SIMInitInfo *parameterBlock)
  990. ;
  991.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  992.         ; parameters:
  993.         ;    parameterBlock  => A0
  994.         ; returns:
  995.         ;    OSErr           <= D0
  996.         Macro
  997.         _SCSIReregisterBus
  998.             moveq               #4,D0
  999.             dc.w                $A089
  1000.         EndM
  1001.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1002.         IMPORT_CFM_FUNCTION SCSIReregisterBus
  1003.     ENDIF
  1004.  
  1005. ;
  1006. ; pascal OSErr SCSIKillXPT(SIMInitInfo *parameterBlock)
  1007. ;
  1008.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1009.         ; parameters:
  1010.         ;    parameterBlock  => A0
  1011.         ; returns:
  1012.         ;    OSErr           <= D0
  1013.         Macro
  1014.         _SCSIKillXPT
  1015.             moveq               #5,D0
  1016.             dc.w                $A089
  1017.         EndM
  1018.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1019.         IMPORT_CFM_FUNCTION SCSIKillXPT
  1020.     ENDIF
  1021.  
  1022.  
  1023.     ENDIF ; __SCSI__ 
  1024.  
  1025.